The slice of a program with respect to program point p and variable x consists of all statements and predicates of the program that might affect the value of x at point p. The value x at program point p is directly affected by assignments to x that reach p and by the loops and conditionals that enclose p. An intraprocedural slice (i.e., the slice of a single procedure) can be determined from the closure of the directly-affects relation.
Program slicing, originally defined in Weiser, M., "Program Slicing," IEEE Transactions on Software Engineering SE-10(4) pp. 352-357 (July 1984), can be used to isolate individual computation threads within a program, which can help a programmer understand complicated code. Program slicing is also used by the algorithm for automatically integrating program variants described in Horwitz, S., Prins. J., and Reps, T., "Integrating non-interfering versions of programs," pp. 133-145 in Conference Record of the Fifteenth ACM Symposium on Principles of Programming Languages, (San Diego, CA, January 13-15, 1988), ACM, New York, NY (1988); slices are used to compute a safe approximation to the change in behavior between a program P and a modified version of P, and to help determine whether two different modifications to P interfere.
In Weiser's terminology, a slicing criterion is a pair &lt;p,V &gt;, where p is a program point and V is a subset of the program's variables. In his work, a slice consists of all statements and predicates of the program that might affect the value of variables in V at point p. This is a more general kind of slice than is often needed: rather than a slice taken with respect to program point p and an arbitrary variable, one is often interested in a slice taken with respect to a variable that is defined at or used at p. Ottenstein and Ottenstein point out how well-suited program dependence graphs are for this kind of slicing and propose that program dependence graphs be used to represent procedures in software development environments. Ottenstein, K.J. and Ottenstein, L.M., "The program dependence graph in a software development environment," Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, (Pittsburgh, PA, Apr. 23-25, 1984), ACM SIGPLAN Notices 19(5) pp. 177-184 (May 1984).